package 常用类.日期处理.test03;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateTest03 {
    public static void main(String[] args) {
        Date time = new Date(4645546);//参数为毫秒
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒 SSS毫秒");
        String strTime = sdf.format(time);
        System.out.println(strTime);
        Date time2 = new Date(System.currentTimeMillis() - (1000*60*60*24*365L));
        String strTime2 = sdf.format(time2);
        System.out.println(strTime2);
    }
}
